/*
 * @Description:登录
 * @Version: 2.0
 * @Autor: wiz
 * @Date: 2022-08-01 10:43:06
 * @LastEditors: wiz
 * @LastEditTime: 2023-10-03 16:26:10
 */
/* eslint-disable max-classes-per-file */
import lexicon from '@/lib/lexicon';

export class T_loginReq {
  private url: string = lexicon.url.login;

  params: {
    userNo: string;

    userPass: string;

    dbName: string;
  };

  dbName: string;

  constructor() {
    this.params = {
      userNo: '',
      userPass: '',
      dbName: ''
    };
  }

  public setUserNo(p: string): T_loginReq {
    this.params.userNo = p;
    return this;
  }

  public setUsePass(p: string): T_loginReq {
    this.params.userPass = p;
    return this;
  }

  public setDbName(p: string): T_loginReq {
    this.dbName = p;
    this.params.dbName = p;
    return this;
  }
}

export interface I_loginReq extends T_loginReq {}

export class T_loginRes {
  success: boolean;

  msg: string;

  data: {
    userID?: string;

    userNo?: string;

    userName?: string;

    token?: string;
  };
}
export interface I_loginRes extends T_loginRes {}
